//
// Created by zhouwd on 2019/7/23.
//

#ifndef IPTVSETTING_MEDIA_VIDEO_DECODE_H
#define IPTVSETTING_MEDIA_VIDEO_DECODE_H
#include "base-thread.h"
#include <media/NdkMediaExtractor.h>
#include "log_util.cpp"
#include <cstdlib>
#include <cstring>
#include <unistd.h>
#include "media_video_frame.h"

typedef class _MEDIA_VIDEO_DECODE :Thread{
private:
    AMediaCodec *videoCodec;
    AMediaExtractor *extractor;
    int32_t width, height;
    MediaVideoFrame *mediaVideoFrame;

public:
    _MEDIA_VIDEO_DECODE();
    ~_MEDIA_VIDEO_DECODE();
    int init(const char *filename);
    void run();
    int startDecode();
    int32_t getWidth();
    int32_t getHeight();
    int initMediaVideoFrame(MediaVideoFrame *mediaVideoFrame);
} MediaVideoDecode;


#endif //IPTVSETTING_MEDIA_VIDEO_DECODE_H
